home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
telecomm
/
sticpsrc.lzh
/
SOURCE.ARC
/
FTP.H
< prev
next >
Wrap
C/C++ Source or Header
|
1989-12-25
|
2KB
|
56 lines
#define CTLZ 26 /* EOF for CP/M systems */
extern char USERFILE[]; /* List of user names and permissions */
#define MAXPATH 8 /* maximal number of path/permission pairs */
/* Description of a list of files */
struct ftp_list {
struct ftp_list *next; /* Linked list pointer */
int isdir; /* Is it a directory? (vs a file) */
char localname[1]; /* Local name of the file */
};
#define NULLFTPLIST (struct ftp_list *)0
/* Per-session control block */
struct ftp {
struct ftp *prev; /* Linked list pointers */
struct ftp *next;
struct tcb *control; /* TCP control connection */
char state;
#define COMMAND_STATE 0 /* Awaiting user command */
#define SENDING_STATE 1 /* Sending data to user */
#define RECEIVING_STATE 2 /* Storing data from user */
char type; /* Transfer type */
#define IMAGE_TYPE 0
#define ASCII_TYPE 1
FILE *fp; /* File descriptor being transferred */
struct socket port; /* Remote port for data connection */
struct tcb *data; /* Data connection */
/* The following are used only by the server */
char *username; /* Arg to USER command */
char *path[MAXPATH]; /* Allowable path prefix */
char perms[MAXPATH]; /* Permission flag bits */
#define FTP_READ 1 /* Read files */
#define FTP_CREATE 2 /* Create new files */
#define FTP_WRITE 4 /* Overwrite or delete existing files */
char *buf; /* Input command buffer */
char cnt; /* Length of input buffer */
char *cd; /* Current directory name */
char *filename; /* "current filename" for XATR/rename */
/* And these are used only by the client */
struct session *session;
struct ftp_list *ftp_list; /* Files to send using "tput" */
int xatr; /* XATR option on? */
struct timer xfertime; /* Timer for current transfer */
};
#define NULLFTP (struct ftp *)0